package com.wiloon.java8x.basic.resource;

import java.net.URL;

/**
 * Created by roy.wang on 2017/4/19;
 */
public class ResourceX {
    public static void main(String[] args) {
        URL url = ClassLoader.getSystemClassLoader().getResource("foo.txt");
        System.out.println(url);
        url = ResourceX.class.getResource("foo.txt");
        System.out.println(url);
        url = ResourceX.class.getResource("/foo.txt");
        System.out.println(url);

        System.out.println(ResourceX.class.getResource(""));
        System.out.println(ResourceX.class.getResource("/"));
        System.out.println(new ResourceX().getClass().getResource("/"));
    }
}
